-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Issue-60730: Addressing the situation where we were saying that (any … #61191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue-60730: Addressing the situation where we were saying that (any … #61191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dfperry5 Thanks for the contribution!
A couple of tips:
- Take a look at the How do I format my changes section to make sure the new introduced changes nicely formatted.
- We also need to add test cases: See Running test section. That will help you to run the tests locally using lit and make sure that things are working as expected.
If you have any question, don't hesitate to ask.
Hope that helps :)
…P)? does not conform to P, instead we should offer the Force Optional error messaging
6837ff1
to
a2d1ef6
Compare
…d get thrown away if we fall into ForceOptional fix
…ean up code per comments
…yConformsToConstraint
…yConformsToConstraint
@swift-ci please test |
@swift-ci please test |
… for non-conforming argument
} | ||
func passLayersOfOptional(value: (any P)??) { | ||
takesP(value) | ||
// expected-error@-1 {{value of optional type '(any P)??' must be unwrapped to a value of type '(any P)?}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is not great... Could you please leave a FIXME(diagnostics):
here to to record multiple ForceUnwrap fixes based on number of optionals we need to unwrap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do I add the "FIXME"? As a comment above the takesP() call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's good enough.
… layers of force unwrap
@swift-ci Please smoke test |
@LucianoPAlmeida / @xedin - not sure if this is a dumb question but when I look at the failure above for MacOS --> (https://ci.swift.org/job/swift-PR-macos-smoke-test/3584/consoleFull#-1537259845d6fdb6cb-f376-4f2e-8bce-d31c7304698b) -- the only error I'm seeing is: UNSUPPORTED: lldb-api :: lang/swift/backwards_compatibility/simple/TestSwiftBackwardsCompatibilitySimple.py (368 of 369) and Exit Code: -9 Any idea on how I can fix that? Looked at it a little today and feeling stumped! |
It’s just a flaky test. |
@swift-ci please test macOS platform |
@swift-ci Please test macOS platform |
1 similar comment
@swift-ci Please test macOS platform |
Looks like I'm not able to kick it again ... not sure why 😆 |
@swift-ci Please test macOS platform |
Let’s give it time :) |
…P)? does not conform to P, instead we should offer the Force Optional error messaging
Addressing Issue-60730 (#60730). In this scenario, we were showing the error message
error: Argument type '(any P)?' does not conform to expected type 'P'
to the user. In the case outlined in the issue, a more informative message would be displayed if we applied theForceOptional
fix, which is exactly what this PR does.Resolves: #60730